package com.lyj.pojo;


import java.io.Serializable;
import java.util.ArrayList;
import java.util.List;

import com.lyj.util.format.DateUtil;

/**
* 
* @author 李艺江
* @version 创建时间：2018年12月11日 下午4:11:08
*/

public class Subject  implements Serializable{

	public static int SINGAL = 1;
	public static int MULTI = 2;
	
	private Long id;
	private String title;
	private int number;
	private Long startTime;
	private Long endTime;
	
	//导航属性，使用关联的实体类对象|集合
	//在一方实体类中加入导航属性：多方实体类对象的集合
	//在多方实体类中加入导航属性：一方实体类对象
	private User user;
	private List<Option> options;
	
	//视图属性：jsp页面中需要的值
	private String startTimeView;
	private String endTimeView;
	private int optionSum;
	private int userSum;
	
	public Subject() {
		this.user = new User();
		this.options = new ArrayList<Option>();
	}
	
	public Long getId() {
		return id;
	}
	public void setId(Long id) {
		this.id = id;
	}
	public String getTitle() {
		return title;
	}
	public void setTitle(String title) {
		this.title = title;
	}
	public int getNumber() {
		return number;
	}
	public void setNumber(int number) {
		this.number = number;
	}
	public Long getStartTime() {
		return startTime;
	}
	public void setStartTime(Long startTime) {
		this.startTime = startTime;
		this.startTimeView = DateUtil.toLongDate(startTime);
	}
	public Long getEndTime() {
		return endTime;
	}
	public void setEndTime(Long endTime) {
		this.endTime = endTime;
		this.endTimeView = DateUtil.toLongDate(endTime);
	}
	public User getUser() {
		return user;
	}
	public void setUser(User user) {
		this.user = user;
	}
	public List<Option> getOptions() {
		return options;
	}
	public void setOptions(List<Option> options) {
		this.options = options;
	}
	
	public String startTimeView() {
		return this.startTimeView;
	}
	
	public String endTimeView() {
		return this.endTimeView;
	}
	
	public void setUserSum(int userSum) {
		this.userSum = userSum;
	}
	public int getUserSum() {
		return this.userSum;
	}
	
	public void setOptionSum() {
		this.optionSum = options.size();
	}
	
	public int getOptionSum() {
		return this.optionSum;
	}

	public String getStartTimeView() {
		return startTimeView;
	}

	public String getEndTimeView() {
		return endTimeView;
	}

	
	
}
